package com.dlc.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dlc.shop.bean.dto.BrandShopDTO;
import com.dlc.shop.bean.model.Brand;
import com.dlc.shop.bean.model.Category;
import com.dlc.shop.bean.model.CategoryShop;
import com.dlc.shop.bean.model.SigningAuditing;
import com.dlc.shop.common.util.PageParam;

import java.util.List;

/**
 * @Author lth
 * @Date 2021/8/19 10:17
 */
public interface SigningAuditingService extends IService<SigningAuditing> {

    /**
     * 申请签约更多分类
     * @param shopId 店铺id
     * @param userId 用户id
     * @param categoryShopList 分类签约列表
     */
    void applyCategory(Long shopId, Long userId, List<CategoryShop> categoryShopList);

    /**
     * 获取可以签约的平台分类列表（已经签约平台分类不会返回）
     * @param shopId
     * @return
     */
    List<Category> listApplySigningCategory(Long shopId);

    /**
     * 获取可以签约的平台品牌列表（已经签约的平台品牌不会返回)
     * @param shopId
     * @param brand
     * @return
     */
    List<Brand> listApplySigningBrand(Long shopId, Brand brand);

    /**
     * 申请签约更多品牌
     * @param shopId
     * @param userId
     * @param brandShopList
     */
    void applyBrand(Long shopId, Long userId, List<BrandShopDTO> brandShopList);

    /**
     * 分页获取待审核的签约信息列表
     * @param page
     * @param signingAuditing
     * @return
     */
    IPage<SigningAuditing> pageSigningAuditing(PageParam<SigningAuditing> page, SigningAuditing signingAuditing);

    /**
     * 审核签约信息
     * @param signingAuditing
     */
    void audit(SigningAuditing signingAuditing);

    /**
     * 撤销申请
     * @param shopId
     * @param type
     */
    void revoke(Long shopId, Integer type);

    /**
     * 根据主键id更新店铺签约分类扣率
     * @param categoryShopId
     * @param rate
     */
    void updateCategoryRate(Long categoryShopId, Double rate);

    /**
     * 增加签约分类
     * @param categoryShopList
     * @param shopId
     */
    void addSigningCategory(List<CategoryShop> categoryShopList, Long shopId);

    /**
     * 商家删除签约分类
     * @param categoryId
     * @param shopId
     */
    void deleteSigningCategory(Long categoryId, Long shopId);

    /**
     * 增加签约品牌
     * @param brandShopDTOList
     * @param shopId
     */
    void addSigningBrand(List<BrandShopDTO> brandShopDTOList, Long shopId);

    /**
     * 商家删除签约品牌
     * @param brandShopId
     */
    void deleteSigningBrand(Long brandShopId);

    /**
     * 获取所有待审核的签约信息
     * @return
     */
    List<SigningAuditing> listAuditingByAutidStatus();
}
